package com.zhiyou100.crowd.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhiyou100.IService.IProService;
import com.zhiyou100.entity.prosGo.TbProjects;


@Controller
@RequestMapping("project")
public class ProController {
	
	@Resource
	private IProService service;
	
	Integer pst_id = 0;
	
	@RequestMapping("queryByType.do")
	public String queryByType(HttpServletRequest request,
			@RequestParam(defaultValue = "-1")Integer pst_id,
			@RequestParam(defaultValue = "0")Integer tr) {
		System.out.println(tr);
		if(pst_id != -1) {
			this.pst_id = pst_id;
		}
		PageHelper.startPage(tr, 8);
		List<TbProjects> list = service.queryByType(this.pst_id);
		PageInfo<TbProjects> page = new PageInfo<TbProjects>(list);
		request.setAttribute("p", page);
		return "gyzc-list";
	}
	
	
	
}

